<template>
  <div id="MyQues">
    <!--使用公共头部区-->
    <c-header :classId2="className"></c-header>
    <!--内容区域-->
    <div class="my-body">
      <div class="my-header">
        <button><i class="el-icon-plus"></i>&nbsp;&nbsp;创建问卷</button>
      </div>
      <div class="my-content">
        <el-table :data="tableData" border style="width: 100%" height="80vh">
          <el-table-column prop="date" label="问卷" align="center" width="260px">
          </el-table-column>
          <el-table-column prop="name" label="状态" align="center">
            <template slot-scope="scope">
              <i :class="scope.row.classId"></i>
              <span>{{scope.row.name}}</span>
            </template>
          </el-table-column>
          <el-table-column prop="province" label="类型" align="center">
          </el-table-column>
          <el-table-column prop="city" label="回收量" align="center">
          </el-table-column>
          <el-table-column prop="address" label="创建时间" align="center">
          </el-table-column>
          <el-table-column fixed="right" label="操作" align="center" width="260px">
            <template slot-scope="scope">
              <el-button v-model="ismask" @click="ismask=!ismask" type="text" size="small">开始调查</el-button>
              <el-button type="text" size="small">暂停调查</el-button>
              <el-button type="text" size="small">导出excel</el-button>
              <el-button type="text" size="small" v-model="MoreMask" @click="MoreMask=!MoreMask">更多</el-button>
            </template>
          </el-table-column>
        </el-table>
        <!--查看更多遮罩层-->
        <transition name="fade">
          <div class="more-mask" v-if="MoreMask">
            <ul>
              <li>
                <a href="#" @click="changeismask()">开始调查</a>
              </li>
              <li>
                <a href="#">暂停调查</a>
              </li>
              <li>
                <a href="#">导出excel</a>
              </li>
              <div class="hr"></div>
              <li>
                <a href="#">统计分析</a>
              </li>
              <li>
                <a href="#">清空数据</a>
              </li>
              <div class="hr"></div>
              <li>
                <a href="#">编辑</a>
              </li>
              <li>
                <a href="#">复制</a>
              </li>
              <li>
                <a href="#">打印</a>
              </li>
              <li>
                <a href="#">删除</a>
              </li>
              <li>
                <a href="#">重命名</a>
              </li>
              <li>
                <a href="#">问卷设置</a>
              </li>
            </ul>
          </div>
        </transition>
      </div>
    </div>
    <!--开始调查遮罩区-->
    <transition name="fade">
    <div class="hidden mask" v-if="ismask">
      <div class="qm-content">
        <h5>开始调查</h5>
        <span class="close" v-model="ismask" @click="ismask=!ismask">X</span>
        <div class="address">
          <input type="text" v-model="urladdress" value="urladdress" />
          <button class="addbtn1">复制</button>
          <button class="addbtn2">打开</button>
        </div>
        <p class="Emp1">
          <span>推送范围</span>
          <el-select v-model="emp1value" placeholder="请选择范围">
            <el-option v-for="emp1item in emp1options" :key="emp1item.emp1value" :label="emp1item.emp1label" :value="emp1item.emp1value">

            </el-option>
          </el-select>
          <button class="emp1btn">导入</button>
        </p>
        <div class="start-body">
          <div class="orga-checkbox">
            <el-tree :data="data2" show-checkbox node-key="id" :props="defaultProps">

            </el-tree>
            <button class="load-more">加载更多</button>
          </div>
          <div class="orga-right">
            <table id="tab1">
              <tr>
                <th>总业主数</th>
                <th>总业主数</th>
                <th>当前覆盖率</th>
              </tr>
              <tr>
                <td>100220户</td>
                <td>5220户</td>
                <td>23%</td>
              </tr>
            </table>
            <table id="tab2">
              <tr>
                <th>小区覆盖率</th>
                <th>起止时间</th>
              </tr>
              <tr>
                <td>1/6</td>
                <td>2017.10.01-2017.10.12</td>
              </tr>
            </table>
          </div>
        </div>
        <div class="mask-btn">
          <button class="mbtn1" v-model="ismask" @click="ismask=!ismask">取消</button>
          <button class="mbtn2">推送</button>
        </div>
      </div>
    </div>
    </transition>
  </div>
</template>

<script>
  //导入公共头部组件
  import cHeader from '../common/quesHeader.vue';
  export default {
    data() {
      return {
        MoreMask: false,
        ismask: false,
        urladdress: 'https://www.baidu.com',
        className: 'active',
        //遮罩层推送范围下拉框数据
        emp1options: [{
          emp1value: '选项1',
          emp1label: '宝安区'
        }, {
          emp1value: '选项2',
          emp1label: '龙岗区'
        }],
        emp1value: '',
        //遮罩层复选框树形控件
        data2: [{
          id: 1,
          label: '华南区',
          children: [{
            id: 4,
            label: '惠州事业部',
            children: [{
              id: 9,
              label: '东城区'
            }, {
              id: 10,
              label: '西城区',
              children: [{
                id: 11,
                label: '老城区'
              }]
            }]
          }]
        }, {
          id: 2,
          label: '华北区',
          children: [{
            id: 5,
            label: '彩生活大厦'
          }, {
            id: 6,
            label: '德香名苑小区'
          }]
        }, {
          id: 3,
          label: '华北区',
          children: [{
            id: 7,
            label: '广州销售部'
          }, {
            id: 8,
            label: '深圳聚财部'
          }]
        }],
        defaultProps: {
          children: 'children',
          label: 'label'
        },
        //表格内容区域
        tableData: [{
          date: '示例--问卷调研用户使用习惯调查(1208107)',
          name: '正在回收',
          province: '商业住宅',
          city: '0',
          address: '2017.10.02',
          classId: 'active'
        }, {
          date: '示例--问卷调研用户使用习惯调查(1208107)',
          name: '暂停回收',
          province: '商业住宅',
          city: '0',
          address: '2017.10.02',
          classId: 'pause'
        }]
      }
    },
    methods: {
      changeismask() {
        this.ismask = true;
        this.MoreMask = false;
      }
    },
    components: {
      "c-header": cHeader
    }
  }
</script>

<style scoped="scoped">	
  #MyQues {
    min-width: 960px;
  }
  /*内容区域*/  
  .my-body {
    padding: 0 10px 10px 10px;
  }
  .my-body .my-header {
    height: 60px;
    line-height: 60px;
  }
  .my-body .my-header button {
    height: 40px;
    line-height: 40px;
    text-align: center;
    background-color: rgb(85, 163, 228);
    color: #fff;
    width: 150px;
    border-radius: 5px;
    border: none;
    font-size: 15px;
    cursor: pointer;
    outline: none;
  }
  .my-content {
    background-color: #fff;
    height: 87vh;
    width: 100%;
    overflow: auto;
    position: relative;
  }
  .my-content .active {
    display: inline-block;
    height: 9px;
    width: 9px;
    border-radius: 50%;
    background-color: greenyellow;
    margin-right: 5px;
  }
  .my-content .pause {
    display: inline-block;
    height: 9px;
    width: 9px;
    border-radius: 50%;
    background-color: red;
    margin-right: 5px;
  }
  /*更多遮罩层*/ 
  #MyQues .more-mask {
    position: absolute;
    top: 1%;
    right: 10%;
    height: 400px;
    width: 150px;
    border: 1px solid #B4BCCC;
    background-color: #fff;
    z-index: 999;
  }
  #MyQues .more-mask ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .more-mask ul li {
    height: 35px;
    width: 100%;
    display: block;
    padding-left: 20px;
  }
  .more-mask ul li a {
    color: black;
    text-decoration: none;
    font-size: 14px;
  }
  .more-mask ul li a:hover {
    color: rgb(22, 155, 213);
  }
  .more-mask .hr {
    height: 1px;
    width: 100%;
    background-color: #DCDCDC;
    margin-bottom: 5px;
  }  
  /*开始调查遮罩区*/ 
  #MyQues .hidden {
    display: none;
  }
  #MyQues .mask {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(0, 0, 0, .8);
    z-index: 99;
    display: block;
  }
  #MyQues .mask .qm-content {
    height: 80vh;
    width: 80vw;
    z-index: 100;
    background: #fff;
    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: -40vw;
    margin-top: -40vh;
    border: 1px solid #ccc;
    overflow: auto;
    padding: 20px 20px 10px 20px;
    box-sizing: border-box;
    border-radius: 5px;
  }
  #MyQues .qm-content h5 {
    margin: 0;
    font-size: 16px;
    font-family: "微软雅黑";
    border-bottom: 1px solid #ccc;
    padding-bottom: 10px;
  }
  #MyQues .qm-content .close {
    position: absolute;
    top: 10px;
    right: 16px;
    font-size: 18px;
    cursor: pointer;
  }
  .qm-content .close:hover {
    color: rgba(255,0,0,.6);
    cursor: pointer;
    transition: color .2s ease-in;
  }
  .qm-content .address {
    margin-top: 20px;
    margin-left: 20px;
    margin-bottom: 40px;
    overflow: hidden;
  }
  .address input[type="text"] {
    height: 25px;
    line-height: 25px;
    border-radius: 5px;
    color: black;
    border: 1px solid #DCDFE6;
    padding: 2px 5px;
    outline: none;
    width: 350px;
    vertical-align: middle;
  }
  .address button {
    height: 30px;
    line-height: 30px;
    width: 100px;
    text-align: center;
    text-align: center;
    color: #333;
    letter-spacing: 2px;
    background-color: #fff;
    border-radius: 5px;
    border: 1px solid #DCDFE6;
    outline: none;
    vertical-align: middle;
    margin-left: 15px;
    cursor: pointer;
  }
  .address button:hover {
    color: rgb(22, 155, 213);
  }
  .Emp1 {
    margin-left: 20px;
  }
  .Emp1 span {
    font-size: 15px;
  }
  .Emp1 .el-select{
  	width: 120px;
  }
	.Emp1 .emp1btn{
		width: 100px;
		height: 30px;
		line-height: 30px;
		border: 1px solid #ccc;
		outline: none;
		background-color: #fff;
		margin-left: 20px;
		display: inline-block;
		vertical-align: middle;
		border-radius: 5px;
		cursor: pointer;
	}
	.Emp1 button:hover {
    color: rgb(22, 155, 213);
  }
  .orga-checkbox {
    border: 1px solid #ccc;
    padding: 10px 5px;
    margin-left: 20px;
    width: 50%;
    display: inline-block;
    vertical-align: top;
  }
  .orga-right {
    display: inline-block;
    width: 45%;
    height: auto;
    vertical-align: top;
  }
  .orga-right table {
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
  }
  .orga-right table th {
    height: 30px;
    line-height: 30px;
    font-weight: normal;
  }
  .qm-content .mask-btn {
    width: 80%;
    margin: 100px auto 10px;
    text-align: center;
  }
  .qm-content .mask-btn button {
    width: 150px;
    height: 35px;
    line-height: 35px;
    border-radius: 5px;
    text-align: center;
    cursor: pointer;
    outline: none;
    border: none;
  }
  .qm-content .mask-btn .mbtn1 {
    background-color: #fff;
    border: 1px solid #ccc;
    color: black;
    margin-right: 5px;
  }
  .qm-content .mask-btn .mbtn2 {
    background-color: rgb(22, 155, 213);
    color: #fff;
    margin-left: 5px;
  }
  .load-more {
    width: 150px;
    height: 30px;
    line-height: 30px;
    background-color: #ccc;
    color: #fff;
    border: none;
    outline: none;
    margin-left: 40%;
    margin-top: 10px;
    cursor: pointer;
  }
  /*遮罩层动画*/
	.fade-enter {
		opacity: 0;
	}
	.fade-enter-active {
		transition: opacity 1s;
	}
	.fade-leave-to {
		opacity: 0;
	}
	.fade-leave-active {
		transition: opacity 1s;
	}
</style>